<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/XGame_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>XGame</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
<link type="text/css" rel="stylesheet" href="CSS/css.css" />
</head>
<?php
include('lock.php');
$qq="select * FROM history WHERE user_ID=$login_session";
$res=mysql_query($qq);
?>
<body>
<div id="container">

<div id="wrapper">

<div id="banner">
<!-- InstanceBeginEditable name="TopLink" -->
<?php
$q = "SELECT user_name FROM user where user_ID = '$login_session'";
$result=mysql_query($q);
$data_fetch=mysql_fetch_array($result);
?>
<ul class="topLink">
<li> Welcome, <a href="UserProfile.php"> <?php echo $data_fetch['user_name']; ?> </a> </li>
<li> <a href="Wishlist.php"> Wishlist </a> &nbsp; | &nbsp;<a href="userShoppingCart.php"> Cart </a> </li>
<li> <a href="Logout.php"> Logout </a> </li>
</ul>
<!-- InstanceEndEditable -->

<img src="Assets/XGame.png" alt="XGame" />
</div>

<div id="menu">
<ul class="nav">
<form method="post" action="search_result.php">
<li> <span> <input type="text" placeholder="Search Keyword" name="search" />
&nbsp; <input type="submit" name="Search" value="Search" /> </span>
</li>
</form>
<li> <a href="Home.php"> Home </a> </li>
<li> <a href="ListOfNews.php"> News </a> </li>
<li> <a href="Games.php"> Games </a> </li>
<li> <a href="FAQ.php"> FAQ </a> </li>
<li> <a href="ContactUs.php"> Contact Us </a> </li>
</ul>

</div>

<div id="main">
<!-- InstanceBeginEditable name="Main" -->
<div class="verticalNav">
<h3> User Account </h3>
<ul>
<li> <a href="Wishlist.php"> Your Wishlist </a> </li>
<li> <a href="userShoppingCart.php"> Shopping Cart </a> </li>
<li> <a href="userCheckOutList.php"> Checkout List </a> </li>
<li> <a href="History.php"> History </a> </li>
</ul>
</div>

<div id="iframe">
<table border="0" class="table">
<tr align="center">
<th class="tableHeader"> History ID</th>
<th class="tableHeader"> Date </th>
<th class="tableHeader">Total Price</th>
<th class="tableHeader"> Order Status</th>
<th class="tableHeader"> Location </th>
<th class="tableHeader">&nbsp;  </th>
</tr>
<?php
while($data_fetch=mysql_fetch_array($res))
{
echo "<tr align='center'>";
echo "<td class='tableContent'>". $data_fetch['history_ID'] ."</td>";
$id = $data_fetch['history_ID'];
echo "<td class='tableContent'>". $data_fetch['order_date'] ."</td>";
echo "<td class='tableContent'>". $data_fetch['order_total_price'] ."</td>";
echo "<td class='tableContent'>". $data_fetch['order_status'] ."</td>";
$query=mysql_query("SELECT location_name from location where location_ID=".$data_fetch['location_ID']."");
$qu=mysql_fetch_array($query);
echo "<td class='tableContent'>". $qu['location_name'] ."</td>";
?>

<td class="tableContent">
<form name="view" action="HistoryOrder.php" method="POST">
<input type="hidden" name="viewID" value="<?php echo "$id"; ?>"/>
<input type="submit" name="view" value="View Game"/>
</form>
</td>

<?php
echo "</tr>";

}
?>
</table>
</div>
<!-- InstanceEndEditable -->
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 XGame </p>
</div>

</div>

</div>

</body>
<!-- InstanceEnd --></html>
